#include "Open_Lcd.h"

#include <fstream>
#include <iostream>
using namespace std;

bool Lcd::isInt = false;

int Lcd::clear(unsigned int color)
{
    if (!isValid())
        return -1;
    for (int i = 0; i < height * width; ++i)
    {
        store[i] = color;
    }
    return 1;
}

int Lcd::set_store(Container *container)
{
    if (!isValid())
        return -1;

    container->renderTo(backBuffer, width, height, 0, 0);

    // 使用统一的渲染方法
    memcpy(store, backBuffer, width * height * 4);

    return 1;
}
